--- title: 'Week 6: The Ground Game ' author: Janet Hernandez date: '2022-10-16' slug: [] categories: - R - Polling - national - local - Economy - incumbancy - ads tags: - plot - regression type: '' subtitle: 'This week I will be looking at how the Ground Game or ' image: '' ---

Note that 2018 in comparison to the model in lab that included more years has a greater correlation it seems of voter turnout and democratic major vote pct.

## 
## Call:
## lm(formula = DemVotesMajorPercent ~ turnout, data = dist_pv_cvap_closed)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -34.060 -12.411  -2.361  11.883  45.749 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   46.623      5.607   8.314 1.52e-15 ***
## turnout       11.132     11.075   1.005    0.315    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.4 on 393 degrees of freedom
## Multiple R-squared:  0.002564,   Adjusted R-squared:  2.583e-05 
## F-statistic:  1.01 on 1 and 393 DF,  p-value: 0.3155
## 
## Call:
## glm(formula = DemVotesMajorPct ~ turnout, family = binomial(link = "logit"), 
##     data = dist_pv_cvap_closed)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -0.70849  -0.24881  -0.04725   0.23968   1.02030  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)
## (Intercept)  -0.1355     0.6847  -0.198    0.843
## turnout       0.4462     1.3528   0.330    0.741
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 44.956  on 394  degrees of freedom
## Residual deviance: 44.847  on 393  degrees of freedom
## AIC: 551.77
## 
## Number of Fisher Scoring iterations: 3

Adding voter turnout into my predictive model to see how it might affect my results.

Observations 1308
Dependent variable turnout
Type OLS linear regression
F(53,1254) 51.97
0.69
Adj. R² 0.67
Est. S.E. t val. p
(Intercept) 183.77 5.01 36.69 0.00
year -0.09 0.00 -36.70 0.00
state.xAlaska 0.08 0.05 1.82 0.07
state.xArizona -0.04 0.02 -1.70 0.09
state.xArkansas -0.05 0.03 -1.99 0.05
state.xCalifornia 0.01 0.02 0.57 0.57
state.xColorado 0.09 0.02 4.00 0.00
state.xConnecticut 0.08 0.02 3.26 0.00
state.xDelaware -0.13 0.05 -2.75 0.01
state.xFlorida -0.02 0.02 -0.84 0.40
state.xGeorgia 0.03 0.02 1.53 0.13
state.xHawaii -0.03 0.03 -0.94 0.34
state.xIdaho -0.03 0.03 -0.87 0.39
state.xIllinois 0.07 0.02 3.95 0.00
state.xIndiana -0.02 0.02 -1.16 0.25
state.xIowa 0.09 0.03 3.30 0.00
state.xKansas 0.04 0.03 1.32 0.19
state.xKentucky 0.02 0.02 0.70 0.48
state.xLouisiana -0.13 0.02 -5.48 0.00
state.xMaine 0.13 0.03 4.10 0.00
state.xMaryland 0.07 0.02 3.35 0.00
state.xMassachusetts 0.02 0.02 1.16 0.25
state.xMichigan 0.08 0.02 4.01 0.00
state.xMinnesota 0.19 0.02 8.69 0.00
state.xMississippi -0.07 0.03 -2.59 0.01
state.xMissouri -0.01 0.02 -0.26 0.79
state.xMontana -0.14 0.05 -2.85 0.00
state.xNebraska 0.13 0.03 4.51 0.00
state.xNevada -0.00 0.03 -0.07 0.95
state.xNew Hampshire 0.11 0.03 3.28 0.00
state.xNew Jersey 0.03 0.02 1.37 0.17
state.xNew Mexico 0.04 0.03 1.34 0.18
state.xNew York -0.03 0.02 -1.40 0.16
state.xNorth Carolina 0.02 0.02 1.08 0.28
state.xNorth Dakota 0.04 0.05 0.90 0.37
state.xOhio 0.03 0.02 1.30 0.19
state.xOklahoma -0.10 0.02 -3.87 0.00
state.xOregon 0.04 0.03 1.65 0.10
state.xPennsylvania 0.03 0.02 1.73 0.08
state.xRhode Island 0.15 0.03 4.44 0.00
state.xSouth Carolina -0.02 0.02 -0.88 0.38
state.xSouth Dakota -0.02 0.05 -0.39 0.70
state.xTennessee -0.07 0.02 -3.23 0.00
state.xTexas -0.04 0.02 -2.03 0.04
state.xUtah 0.02 0.03 0.89 0.37
state.xVermont 0.09 0.05 2.02 0.04
state.xVirginia 0.04 0.02 2.05 0.04
state.xWashington 0.09 0.02 4.16 0.00
state.xWest Virginia -0.01 0.03 -0.17 0.86
state.xWisconsin 0.15 0.02 7.03 0.00
state.xWyoming 0.10 0.05 2.14 0.03
president_partyR 0.52 0.01 39.68 0.00
cvap 0.00 0.00 15.55 0.00
winner_candidate_incIncumbent -0.01 0.01 -2.16 0.03
Standard errors: OLS

Plotting differences in margin for turnout to test the accuracy of my prediction variable for 2022 turnout to add to my model later. Red indicates that the actual value is less than predicted value, therefore my model is under predicting in the red areas. The same goes for the blue. Where its more blue, such as in Florida, the predictive model is having a hard time and is over predicting these areas for voter turnout.